package com.jim.healio.dto;

import lombok.Data;

import java.util.ArrayList;
import java.util.List;

@Data
public class History {

    private List<Message> messages;

    public History() {
        this.messages = new ArrayList<>();
    }

    public void addMessage(Message message) {
        this.messages.add(message);
    }

    public String toString() {
        StringBuilder sb = new StringBuilder();
        for (Message message : messages) {
            sb.append(message.toString()).append("\n");
        }

        return sb.toString();
    }
}
